Skip to content

fix(engine): guard the guardrail engine and gate-advisory/predicted-gate files themselves - #8713

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-8698
Jul 26, 2026
Merged

fix(engine): guard the guardrail engine and gate-advisory/predicted-gate files themselves#8713
JSONbored merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-8698

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

fix(engine): guard the guardrail engine and gate-advisory/predicted-gate files themselves

ENGINE_DECISION_GUARDRAIL_GLOBS listed the host/engine shim pairs for
autonomy.ts and guardrail-config.ts, but never the packages/loopover-engine
files that actually decide a PR's disposition: change-guardrail.ts (the glob
matcher powering isGuardrailHit/guardrailPathMatches), gate-advisory.ts (the
gate-decision core and check-run sanitizer), and predicted-gate.ts (the
orchestrator wiring both). A PR weakening the matcher, flipping a
block/advisory disposition, or rewiring the orchestrator would not itself trip
the hard guardrail — a self-referential blind spot in the exact mechanism
meant to catch that class of change.

Add all three engine-side paths and cover each with a test asserting
isGuardrailHit trips against resolveHardGuardrailGlobs(null).

Closes #8698

…ate files themselves

ENGINE_DECISION_GUARDRAIL_GLOBS listed the host/engine shim pairs for
autonomy.ts and guardrail-config.ts, but never the packages/loopover-engine
files that actually decide a PR's disposition: change-guardrail.ts (the glob
matcher powering isGuardrailHit/guardrailPathMatches), gate-advisory.ts (the
gate-decision core and check-run sanitizer), and predicted-gate.ts (the
orchestrator wiring both). A PR weakening the matcher, flipping a
block/advisory disposition, or rewiring the orchestrator would not itself trip
the hard guardrail — a self-referential blind spot in the exact mechanism
meant to catch that class of change.

Add all three engine-side paths and cover each with a test asserting
isGuardrailHit trips against resolveHardGuardrailGlobs(null).

Closes JSONbored#8698
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 26, 2026 00:21
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.78%. Comparing base (c6fad5d) to head (991566b).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8713      +/-   ##
==========================================
- Coverage   93.79%   93.78%   -0.01%     
==========================================
  Files         797      797              
  Lines       79480    79480              
  Branches    24078    24078              
==========================================
- Hits        74545    74541       -4     
  Misses       3563     3563              
- Partials     1372     1376       +4     
Flag Coverage Δ
backend 95.05% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ges/loopover-engine/src/review/guardrail-config.ts 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 00:38:35 UTC

2 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR closes a genuine self-referential gap: change-guardrail.ts, gate-advisory.ts, and predicted-gate.ts are the actual disposition-deciding files but were absent from ENGINE_DECISION_GUARDRAIL_GLOBS, so a PR editing only those files bypassed the hard guardrail. The fix is a straightforward glob-list addition following the exact pattern already established for autonomy.ts/guardrail-config.ts real-path entries, and the new tests directly exercise isGuardrailHit against the added paths via resolveHardGuardrailGlobs(null), which is the real production call path, not a fabricated scenario. This is narrow, well-targeted, and closes issue #8698.

Nits — 3 non-blocking
  • The paths packages/loopover-engine/src/advisory/gate-advisory.ts and packages/loopover-engine/src/predicted-gate.ts are asserted to exist by the PR description but their directory structure (advisory/ subfolder, no src/ prefix on predicted-gate.ts) isn't independently verifiable from the diff alone — worth double-checking against the actual package layout.
  • Comment block at guardrail-config.ts:54-59 is fairly long relative to the 3-line addition it explains; could be tightened to match the terser style of the surrounding entries.
  • Consider a follow-up test asserting the reverse — that a PR touching an unrelated engine file does NOT trip this guardrail — to guard against over-broad glob matching in change-guardrail.ts.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8698
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 28 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 44 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds all three engine-package files to ENGINE_DECISION_GUARDRAIL_GLOBS and includes tests directly asserting isGuardrailHit returns true for each against resolveHardGuardrailGlobs(null), matching all four listed deliverables.

Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 44 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 26, 2026
@JSONbored
JSONbored merged commit 44f4ee9 into JSONbored:main Jul 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(engine): ENGINE_DECISION_GUARDRAIL_GLOBS omits the guardrail-matching engine itself and the gate-advisory/predicted-gate orchestrator files

2 participants